home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4920 < prev    next >
Encoding:
Text File  |  1996-08-05  |  734 b   |  27 lines

  1. Path: gail.ripco.com!mambuhl
  2. From: mambuhl@ripco.com (Martin Ambuhl)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Converting integer to
  5. Date: 10 Feb 1996 07:58:37 GMT
  6. Organization: Ripco Communications, Inc.
  7. Message-ID: <4fhj7d$fe2@gail.ripco.com>
  8. NNTP-Posting-Host: golden.ripco.com
  9.  
  10. Gilbert Banks <gilbertb@bnr.ca>
  11. in <4f5ehf$48i@brtph500.bnr.ca> asks:
  12.  
  13. >What is the function and header for converting an integer to char or string?
  14. >I think the header is <stdlib.h>.
  15.  
  16. #include <stdio.h>
  17. /* ... */
  18. char theString[BUFSIZ]; /* whatever's enough */
  19. int theInteger;
  20. /* ... */
  21.     sprintf(theString,"%d",theInteger);
  22. /* ... */
  23.                                               
  24. --
  25. * Martin Ambuhl       net: mambuhl@ripco.com
  26. * Chicago, IL (USA)    
  27.